package com.yuanmai.fly3.demo.filters;

import com.google.inject.Singleton;
import com.yuanmai.fly3.Fly3;
import com.yuanmai.fly3.RequestCycle;
import com.yuanmai.fly3.interceptor.HandlerInterceptor;

/**
 * Created by xux on 2017/5/13.
 */
@Singleton
public class DemoFilter implements HandlerInterceptor {


    @Override
    public boolean preHandle(RequestCycle requestCycle) throws Exception {
        Fly3.instance.getLogger().info("初始化 DemoFilter.preHandle");
        return true;
    }

    @Override
    public void postHandle(RequestCycle requestCycle, Object o) throws Exception {
        Fly3.instance.getLogger().info("初始化 DemoFilter.postHandle");
    }



    @Override
    public void destroy() {
        Fly3.instance.getLogger().info("初始化 DemoFilter.destroy");
    }
}
